#include "T_ControlActionScene.h"

T_ControlActionScene::T_ControlActionScene()
{
}

T_ControlActionScene::~T_ControlActionScene()
{
}

bool T_ControlActionScene::OnInit( GAF_CBundle* pParam )
{
	m_pimgObj =GAF_CImage::Create("./res/Window.bmp");
	AddGraphics(m_pimgObj);

	GAF_CControlMap _cmLocaX;
	_cmLocaX.AddMark(20, 600);
	m_catAny.AddControl<int>("LocaX", GetLocation().nX, _cmLocaX, 3000, 50, GAF::ACTION_AGAIN);

	GAF_CControlMap _cmLocaY;
	_cmLocaY.AddMark(60, 400);
	m_catAny.AddControl<int>("LocaY", GetLocation().nY, _cmLocaY, 3000, 50, GAF::ACTION_RETURN);

	GAF_CControlMap _cmZoomX;
	_cmZoomX.Adjust(1);
	_cmZoomX.AddMark(35, 0.5);
	_cmZoomX.AddMark(70, 2);
	m_catAny.AddControl<double>("ZoomX", GetZoomX(), _cmZoomX, 3000, 50, GAF::ACTION_AGAIN);

	GAF_CControlMap _cmZoomY;
	_cmZoomY.Adjust(1);
	_cmZoomY.AddMark(30, 2);
	_cmZoomY.AddMark(65, 0.7);
	m_catAny.AddControl<double>("ZoomY", GetZoomY(), _cmZoomY, 3000, 50, GAF::ACTION_AGAIN);




	m_catAny.SetHostGraphics(m_pimgObj);

	return true;
}

bool T_ControlActionScene::OnStart()
{
	m_catAny.Play();
	return true;
}

void T_ControlActionScene::OnKeyUp(int nKeyCode)
{
	ReturnOK();
}

void T_ControlActionScene::OnEnd()
{
	m_catAny.Stop();
}
